package cn.kgc.springboot.service.impl;

import cn.kgc.springboot.entity.User;
import cn.kgc.springboot.mapper.UserMapper;
import cn.kgc.springboot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: mosin
 * @version: v1.0  2022/8/10
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectByUserName(String principal) {

        User user =   userMapper.selectByUserName(principal);
        return user;
    }

    @Override
    public void addUser(User user) {
        userMapper.insertUser(user);
    }
}
